﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace ShootSearch.Core
{
    public class AssemblyWithConfigArray: List<AssemblyWithConfig> , IXmlSerializable
    {
        #region IXmlSerializable Members

        public System.Xml.Schema.XmlSchema GetSchema()
        {
            return new System.Xml.Schema.XmlSchema();
        }

        public void ReadXml(System.Xml.XmlReader reader)
        {
            while (reader.ReadToFollowing("Item"))
            {
                AssemblyWithConfig item = new AssemblyWithConfig();
                item.ReadXml(reader);
                this.Add(item);
            }

        }

        public void WriteXml(System.Xml.XmlWriter writer)
        {
            for (int i = 0; i < this.Count; i++)
            {
                writer.WriteStartElement("Item");

                this[i].WriteXml(writer);

                writer.WriteEndElement();

            }
        }

        #endregion
    }
}
